<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCartTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
	{
        Schema::create('cart', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('uid')->index()->comment('用户id');
            $table->integer('gid')->unique()->comment('商品价格表id');
            $table->integer('buy_num')->comment('购买数量');
            $table->timestamps();
			$table->string('attr1' ,50)->nullable();
			$table->string('attr2' ,100)->nullable();
			$table->string('attr3' ,150)->nullable();
		});
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cart');
    }
}